Optimal. Leaf size=35 \[ 2 \tanh ^{-1}\left (\frac {1-x}{2 \sqrt {x^2+x+1}}\right )+\sinh ^{-1}\left (\frac {2 x+1}{\sqrt {3}}\right ) \]
________________________________________________________________________________________
Rubi [A] time = 0.03, antiderivative size = 35, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.263, Rules used = {843, 619, 215, 724, 206} \begin {gather*} 2 \tanh ^{-1}\left (\frac {1-x}{2 \sqrt {x^2+x+1}}\right )+\sinh ^{-1}\left (\frac {2 x+1}{\sqrt {3}}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 206
Rule 215
Rule 619
Rule 724
Rule 843
Rubi steps
\begin {align*} \int \frac {-1+x}{(1+x) \sqrt {1+x+x^2}} \, dx &=-\left (2 \int \frac {1}{(1+x) \sqrt {1+x+x^2}} \, dx\right )+\int \frac {1}{\sqrt {1+x+x^2}} \, dx\\ &=4 \operatorname {Subst}\left (\int \frac {1}{4-x^2} \, dx,x,\frac {1-x}{\sqrt {1+x+x^2}}\right )+\frac {\operatorname {Subst}\left (\int \frac {1}{\sqrt {1+\frac {x^2}{3}}} \, dx,x,1+2 x\right )}{\sqrt {3}}\\ &=\sinh ^{-1}\left (\frac {1+2 x}{\sqrt {3}}\right )+2 \tanh ^{-1}\left (\frac {1-x}{2 \sqrt {1+x+x^2}}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.01, size = 35, normalized size = 1.00 \begin {gather*} 2 \tanh ^{-1}\left (\frac {1-x}{2 \sqrt {x^2+x+1}}\right )+\sinh ^{-1}\left (\frac {2 x+1}{\sqrt {3}}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [A] time = 0.24, size = 39, normalized size = 1.11 \begin {gather*} -\log \left (2 \sqrt {x^2+x+1}-2 x-1\right )-4 \tanh ^{-1}\left (-\sqrt {x^2+x+1}+x+1\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.42, size = 50, normalized size = 1.43 \begin {gather*} 2 \, \log \left (-x + \sqrt {x^{2} + x + 1}\right ) - 2 \, \log \left (-x + \sqrt {x^{2} + x + 1} - 2\right ) - \log \left (-2 \, x + 2 \, \sqrt {x^{2} + x + 1} - 1\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.18, size = 52, normalized size = 1.49 \begin {gather*} -\log \left (-2 \, x + 2 \, \sqrt {x^{2} + x + 1} - 1\right ) + 2 \, \log \left ({\left | -x + \sqrt {x^{2} + x + 1} \right |}\right ) - 2 \, \log \left ({\left | -x + \sqrt {x^{2} + x + 1} - 2 \right |}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.01, size = 32, normalized size = 0.91 \begin {gather*} \arcsinh \left (\frac {2 \sqrt {3}\, \left (x +\frac {1}{2}\right )}{3}\right )+2 \arctanh \left (\frac {-x +1}{2 \sqrt {-x +\left (x +1\right )^{2}}}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 1.18, size = 41, normalized size = 1.17 \begin {gather*} \operatorname {arsinh}\left (\frac {2}{3} \, \sqrt {3} x + \frac {1}{3} \, \sqrt {3}\right ) - 2 \, \operatorname {arsinh}\left (\frac {\sqrt {3} x}{3 \, {\left | x + 1 \right |}} - \frac {\sqrt {3}}{3 \, {\left | x + 1 \right |}}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.03 \begin {gather*} \int \frac {x-1}{\left (x+1\right )\,\sqrt {x^2+x+1}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {x - 1}{\left (x + 1\right ) \sqrt {x^{2} + x + 1}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________